package com.suxin.plugin.intergration.factory.process.pip.classs.group;

import com.suxin.plugin.intergration.factory.process.pip.classs.PluginClassGroup;
import com.suxin.plugin.pf4j.BasePlugin;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

/**
 * @author Tang
 * @classname ComponentGroup
 * @description [  ]
 * @date 2022/7/21 21:57
 */
public class ComponentGroup implements PluginClassGroup {

    public static final String GROUP_ID = "spring_component";

    @Override
    public String groupId() {
        return GROUP_ID;
    }

    @Override
    public void initialize(BasePlugin basePlugin) {

    }

    @Override
    public boolean filter(Class<?> aClass) {
        return AnnotationUtils.isAnnotationDeclaredLocally(Component.class,aClass) ||
                AnnotationUtils.isAnnotationDeclaredLocally(Service.class,aClass);
    }
}
